<!DOCTYPE html>
<html>
<head>
    <title></title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="2">
                    <i-input v-model="q.authorid" @on-enter="query" placeholder="用户编号"/>
                </i-col>
                <i-col span="2">
                    <i-select v-model="q.type">
                        <i-option v-for="cate in categorys" :value="cate.id" :key="cate.id">{{cate.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="2">

                    <!--<Date-picker  v-model="q.begin" @on-enter="query"  placeholder="开始时间" value-format="yyyy-MM-dd HH:mm"  format="yyyy-MM-dd HH:mm" />-->
                    <i-input  v-model="q.begin" @on-enter="query"  placeholder="开始时间" />

                </i-col>
                <i-col span="2">
                    <!--<Date-picker  v-model="q.end" @on-enter="query"   placeholder="结束时间" value-format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm" />-->
                    <i-input  v-model="q.end" @on-enter="query"   placeholder="结束时间"  />
                </i-col>
                    <!--<i-input  v-model="q.end" @on-enter="query"   placeholder="结束时间"  />-->
                    <i-col span="3">
                        <i-select v-model="q.enabled" placeholder="上架/下架">
                            <i-option value="0">下架</i-option>
                            <i-option value="1">上架</i-option>
                        </i-select>
                    </i-col>
                <i-col span="3">
                    <i-select v-model="q.dtype" placeholder="动态类型">
                        <i-option value="1">图文动态</i-option>
                        <i-option value="2">视频动态</i-option>
                    </i-select>
                </i-col>

                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("dynamic:info"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;查看</i-button>
                #end
                #if($shiro.hasPermission("dynamic:check"))
                <i-button type="success" @click="check"><i class="fa fa-plus"></i>&nbsp;审核确认</i-button>
                #end
                #if($shiro.hasPermission("dynamic:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("dynamic:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                <!--#if($shiro.hasPermission("dynamic:delete"))-->
                <!--<i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>-->
                <!--#end-->
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="cmsNews" :rules="ruleValidate" :label-width="80">
            <Form-item label="用户编号" prop="authorid">
                <i-input v-model="cmsNews.authorid" placeholder="用户编号" readeonly />
            </Form-item>

            <Form-item label="用户名" prop="authorname" style="width: 268px;">


                <i-input v-model="cmsNews.authorname" placeholder="用户名" readeonly />
            </Form-item>
            <Form-item label="动态分类" prop="categorys">
                <Checkbox-group v-model="cmsNews.categoryIDlist">
                    <Checkbox :label="category.id" v-for="category in categorys">{{category.name}}</Checkbox>
                </Checkbox-group>
            </Form-item>
            <Form-item label="点赞数量" prop="praise">
                <Input-number :min="0" :step="1" v-model="cmsNews.praise" placeholder="点赞数量"
                              style="width: 188px;"/>
                <!--<i-input v-model="cmsNews.praise" placeholder="点赞数量"/>-->
            </Form-item>

            <Row>
                <i-col span="16">
                    <Form-item label="动态图片" prop="imageUrl">
                        <i-input v-model="cmsNews.imageUrl" placeholder="新闻图片" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload?prefix=dynamic" :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImagePicUrl">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item label="推荐" prop="isrecommend">
                <Radio-group v-model="cmsNews.isrecommend">
                    <Radio label="1">
                        <span>推荐</span>
                    </Radio>
                    <Radio label="0">
                        <span>不推荐</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="状态" prop="enabled">
                <Radio-group v-model="cmsNews.enabled">
                    <Radio label="1">
                        <span>上架</span>
                    </Radio>
                    <Radio label="0">
                        <span>下架</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="动态内容" prop="newdes">
               <i-input  v-model="cmsNews.newdes" type="textarea" :autosize="true" ></i-input>
            </Form-item>
            <Form-item label="动态视频" style="width: 70vw"  >
                <video  controls :src="cmsNews.video" style="height: 45vw;width: 50vw"  ></video>
            </Form-item>
            <Form-item label="动态图片" prop="dynamicPicture">
                <div id="dynamicPicture"></div>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>
<!--<p>-->
<!--商品详情网址：-->
<!--<br>正式服务器： http://h5s.dongdongty.com/goods/new.html?gid=1-->
<!--<br>测试服务器： http://47.92.244.56:8082/html/goods/new.html?gid=1-->
<!--</p>-->

<script src="${rc.contextPath}/js/dynamic/userdynamic.js?_${date.systemTime}"></script>
</body>
</html>